package red.ouo.distributedtools.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import red.ouo.distributedtools.redis.service.RedisMessage;
import red.ouo.distributedtools.standard.message.MessageBody;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class Test {
    @Resource
    RedisMessage.Sender<String> sender;
    @PostMapping("/test-send")
    String send(){
        sender.send("test",MessageBody.<String>builder()
                .name("sss")
                .data("sss1")
                .type((byte) 1)
                .build());
        return "OK";
    }
}
